package com.nbc.car.biz.entity;

import java.util.Date;

/**
 * Created by yp-bp-m-7046 on 16/7/19.
 */
public class Token {

    /**
     登陆用户的主键id
     */
    private long userId;
    /**
    token码 md5,登陆时生成,与用户1对1
     */
    private String token;
    /**
    用户登陆设备id
     */
    private String deviceId;
    /**
    用户登陆设备类型 设备类型 0:web 1:ios 2:android
     */
    private short deviceType;
    /**
    设备推送消息id
     */
    private String pushId;
    /**
    用户登陆次数
     */
    private long loginCount;

    /**
     * 最后登陆时间
     */
    private Date lastLoginTime;

    /**
    time to live 过期时间 分钟为单位
     */
    private int ttl;
    /**
    注册时间
     */
    private Date createTime;
    public Token(){}
    public Token(long userId, String deviceId, short deviceType, String pushId, long loginCount,Date lastLoginTime, int ttl) {
        this.userId = userId;
        this.deviceId = deviceId;
        this.deviceType = deviceType;
        this.pushId = pushId;
        this.loginCount = loginCount;
        this.lastLoginTime = lastLoginTime;
        this.ttl = ttl;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public short getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(short deviceType) {
        this.deviceType = deviceType;
    }

    public String getPushId() {
        return pushId;
    }

    public void setPushId(String pushId) {
        this.pushId = pushId;
    }

    public int getTtl() {
        return ttl;
    }

    public void setTtl(int ttl) {
        this.ttl = ttl;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public long getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(long loginCount) {
        this.loginCount = loginCount;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
}
